<?php

namespace App\Http\Controllers;

use Houdunwang\WeChat\WeChat;
use Illuminate\Http\Request;
use Modules\Wx\Entities\Wxconfig;

class WxController extends Controller
{
    //微信服务器配置
    public function weixin(Wxconfig $wxconfig)
    {
        //查询数据库中的数据与配置项合并
        $config = array_merge(config('weixin'), $wxconfig->query()->pluck('value', 'name')->toArray());
        (new WeChat)->config($config);
        (new WeChat)->valid();
    }
}
